
DATE=$(date +%Y%m%d)
echo $DATE

log_access='/var/www/SITES/log/nginx/access/'
log_error='/var/www/SITES/log/nginx/error/'

echo "################## MAKE DIR"
mkdir -p $log_access
mkdir -p $log_error
echo "################## BACK "

goaccess -f /var/log/nginx/access.log --log-format='%h %^[%d:%^] "%r" %s %b "%R" "%u"' --date-format='%d/%b/%Y' -a > $log_access$DATE.html

cp /var/log/nginx/error.log $log_error$DATE.html
